package com.ffsky.ffui.demo.data;

import com.gitee.hljdrl.ffkit.app.FFKitAboutActivity;
import com.gitee.hljdrl.ffkit.bean.FFKitLink;
import com.gitee.hljdrl.ffkit.builder.FFKitLinkSource;
import com.gitee.hljdrl.ffkit.fragment.FFKitColorFragment;

import java.util.ArrayList;
import java.util.List;

public class MyDataSource extends FFKitLinkSource {


    @Override
    public List<FFKitLink> getList() {
        List<FFKitLink> list = new ArrayList<>();
        //----------------------------------------------------------------
        list.add(new FFKitLink.Builder().setName("关于").setActivityClass(FFKitAboutActivity.class).build());
        //-------------
        list.add(new FFKitLink.Builder().setName("Fragment").setFragmentClass(FFKitColorFragment.class).build());
        //-------------
        list.add(new FFKitLink.Builder().setName("Fragment List").addFragmentClass(FFKitColorFragment.class, FFKitColorFragment.class, FFKitColorFragment.class, FFKitColorFragment.class).build());
        //-------------

//
//        list.add(new FFKitLink.Builder().setName("IVDialog").setDesc("IVDialog setViewPartVisitor").setOnExecuteListener(new OnExecuteListener() {
//            @Override
//            public void onExecute(Activity activity) {
////                IVDialog dialog = new IVDialog(activity);
////                dialog.setTitle("提示");
////                dialog.setContent("这是一个IVDialog");
////                dialog.setEventListener(new IVEventListener() {
////                    @Override
////                    public void onItemClick(boolean isLeft, Dialog dialog) {
////                        IVToast.toast(IVToastEvent.STYLE_INFO, "onItemClick-->isLeft=" + isLeft);
////                        dialog.dismiss();
////                    }
////                });
////                dialog.show();
//
//                PromptVisitor promptVisitor = new PromptVisitor();
//                promptVisitor.setTitle("提示").setContent("这是一个IVDialog")
//                        .setOnEventListener("AAA", "BBB", new UIEventListener() {
//                            @Override
//                            public void onItemClick(boolean isLeft, Dialog dialog) {
//                                IVToast.toast(IVToastEvent.STYLE_INFO, "onItemClick-->isLeft=" + isLeft);
//                                dialog.dismiss();
//                            }
//                        })
//                        .show(activity);
//            }
//        }).build());
//
//        list.add(new FFKitLink.Builder().setName("ProgressVisitor").setDesc("IVDialog setViewPartVisitor").setOnExecuteListener(new OnExecuteListener() {
//            @Override
//            public void onExecute(Activity activity) {
//                ProgressVisitor progressVisitor = new ProgressVisitor();
//                progressVisitor.setProgressText("加载中");
//                progressVisitor.setOnVisitedListener(new OnVisitedListener() {
//                    @Override
//                    public void onVisited(Dialog dialog, View view) {
//                        view.postDelayed(new Runnable() {
//                            @Override
//                            public void run() {
//                                dialog.dismiss();
//                            }
//                        }, 4000);
//                    }
//                }).show(activity);
//
//            }
//        }).build());
//
//        list.add(new FFKitLink.Builder().setName("SheetVisitor").setDesc("IVSheetDialog setViewPartVisitor").setOnExecuteListener(new OnExecuteListener() {
//            @Override
//            public void onExecute(Activity activity) {
//                SheetVisitor sheetVisitor = new SheetVisitor(activity, "选择A-B-C");
//                List<IVSheet> option = new ArrayList<>();
//                option.add(new IVSheet("选项一", "1"));
//                option.add(new IVSheet("选项二", "2"));
//                option.add(new IVSheet("选项三", "3"));
//                sheetVisitor.setList(option);
//                sheetVisitor.setIvSheetListener(new IVSheetListener() {
//                    @Override
//                    public void onSheetSelected(IVSheet sheet, int selectIndex) {
//                        IVToast.toast("onSheetSelected-->" + selectIndex);
//                    }
//
//                    @Override
//                    public void onSheetCancel() {
//                        IVToast.toast("onSheetCancel");
//                    }
//                });
//                sheetVisitor.show(activity);
//            }
//        }).build());


        return list;
    }

    @Override
    public String getAppName() {
        return "devkit app";
    }
}
